/**
* @(#)demo.test.book.advice.ReflectConstructor.java
* 南京中兴软创科技有限责任公司
* @date 2014-1-14
*/
package demo.test.book.advice;

import java.lang.reflect.Constructor;

/** 
 * 
 * @author <a href="tong.hao@zte.com.cn">童浩</a>
 * @version 1.0 
 * @since 2014-1-14 下午4:14:45 
 */

public class ReflectConstructor {
	public static void main(String[] args) throws Exception {
		Class c = Class.forName("demo.test.book.advice.Util");
		/*Util u = (Util) c.newInstance();
		u.f();*/
		
		//c.getConstructor().newInstance();
		
		Constructor co = c.getDeclaredConstructor();
		co.setAccessible(true);
		
		co.newInstance();
	}
}


class Util {
	private Util(){
		System.out.println("Util.Util()");
	}
	public Util(String s){
		System.out.println("Util.Util()" + s);
	}
	
	public void f() {
		System.out.println("Util.f()");
	}
}